import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Java003 {
    public static void main(String[] args) {
        HashMap<Character,Integer> map = new HashMap<Character,Integer>();
        Scanner sc = new Scanner(System.in);
        System.out.println("Stirng");
        String s = sc.nextLine();
        System.out.println("Num");
        int NUM = sc.nextInt();
        int flag=0;
        Set<Map.Entry<Character,Integer>> entries=map.entrySet();
        for(int i=0;i<s.length();i++){
            if(map.containsKey(s.charAt(i))){
                Integer num = map.get(s.charAt(i));
                map.put(s.charAt(i),num+1);
            }else{
                map.put(s.charAt(i),1);
            }
        }
//        for(Map.Entry<Character,Integer> entry:entries){
//            System.out.println(entry.getKey()+" : "+entry.getValue());
//        }
        System.out.println("The letter appears 4 times");

        for(Map.Entry<Character,Integer> entry:entries){
            if(entry.getValue()==NUM){
                System.out.println(entry.getKey());
                flag=1;
            }
        }
        if(flag==0){
            System.out.println("NULL");
        }
    }
}
